import request from '@/utils/request.js';

export const listDept = (query) => {
	return request({
		url: '/dept/pages',
		method: 'get',
		params: query,
	});
};

export const deleteDept = (id) => {
	return request({
		url: `/dept/${id}`,
		method: 'delete',
	});
};

export const getDeptInfo = (id) => {
	return request({
		url: `/dept/${id}`,
		method: 'get',
	});
};

export const addDept = (data) => {
	return request({
		url: `/dept`,
		method: 'post',
		data,
	});
};

export const updateDept = (data) => {
	return request({
		url: `/dept`,
		method: 'put',
		data,
	});
};
